package main

import "fmt"

// Author : CSR丶WARRIOR
// Time ： 2020/10/14  20:39
// TOOLS : GoLand
// FILENAME : structSlice.go
// STATEMENT: 

type Person1 struct {
	id   int
	name string
	age  int
	addr string
}

func main() {
	createSlice()
}

func createSlice() {
	var p1 Person1 = Person1{
		id:   1,
		name: "张三",
		age:  20,
		addr: "北京",
	}
	var p2 Person1 = Person1{
		id:   2,
		name: "李四",
		age:  23,
		addr: "上海",
	}
	var p3 Person1 = Person1{
		id:   3,
		name: "王五",
		age:  30,
		addr: "广州",
	}
	var Person1Slice = make([]Person1, 0)
	Person1Slice = append(Person1Slice, p1, p2, p3)
	fmt.Println(Person1Slice) /*[{1 张三 20 北京} {2 李四 23 上海} {3 王五 30 广州}]*/
}
